<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>乐扣游戏商城</title>
  <link rel="shortcut icon" href="favicon.ico" />
  <link rel="stylesheet" href="css/register.css">
  <link rel="stylesheet" href="css/base.css">
</head>

<body>
  <!-- header模块 -->
  <header>
    <div class="header-l">
      <a href="index.html">
        <img src="images/logo.png" alt="">
      </a>
    </div>
    <div class="header-r">
      <ul>
        <li>
          <a href="index.html">商店</a>
        </li>
        <li>
          <a href="community.html">社区</a>
        </li>
        <li>
          <a href="ranking.html">排行榜</a>
        </li>
        <li>
          <a href="javascript:;">客服</a>
        </li>
      </ul>
    </div>
  </header>

  <!-- 主体模块 -->
  <div class="w">
    <div class="box-l">

    </div>
    <div class="box-r">
      <h1>注册</h1>
      <div class="reg_form">
        <ul>
          <li>
            <p>手机号</p>
            <input type="text" class="phone">
          </li>
          <li>
            <p>获取短信</p>
            <input type="text" class="yzm"><button class="btn-yzm">获取验证码</button>
          </li>
          <li>
            <p>设置密码</p>
            <input type="password" class="pwd">
          </li>
          <li class="check">
            <input type="checkbox"> 已阅读并接收<a href="#"> ( 注册协议 ) </a>
          </li>
          <li>
            <button class="zhuce">注册</button>
          </li>
          <li class="login">
            <a href="login.html">已有账号？去登录</a>
          </li>
        </ul>
      </div>
    </div>
  </div>

  <!-- 底部模块 -->
  <footer>
    <div class="mod_copyright">
      <div class="links">
        <a href="#">关于我们</a> | <a href="#">联系我们</a> | <a href="#">联系客服</a> | <a href="#">商家入驻</a> | <a href="#">营销中心</a>
        |
        <a href="#">友情链接</a> | <a href="#">销售联盟</a> | <a href="#">游戏社区</a> |<a href="#">爱心公益</a>|
        <a href="#">English Site</a> | <a href="#">Contact U</a>
      </div>
      <div class="copyright">
        地址：嘉应学院江北校区东区学生宿舍 | 电话：13434940752 | 邮箱: 1960144768@qq.com <br>
      </div>
    </div>
  </footer>


  <script>
    var phone = document.querySelector('.phone');
    var btn = document.querySelector('.btn-yzm');
    btn.onclick = function () {
      if (phone.value == '') {
        alert('手机号不能为空');
      } else {
        alert('验证码已发送');
      }
    }


    var yzm = document.querySelector('.yzm');
    var pwd = document.querySelector('.pwd');

    var button = document.querySelector('.zhuce');

    button.onclick = function () {
      if (phone.value == '' || yzm.value == '' || pwd.value == '') {
        alert('请你输入手机号/验证码/密码');
      } else {
        var href = document.querySelector('.zhuce');
        href.onclick = function () {
            href.innerHTML = "跳转中...";
            console.log(1);
            var time=2;
            setInterval(function(){
                if(time == 0){
                    location.href = './login.html';
                }else{
                    time--;
                }
            },1000)

        }
      }
    }
  </script>
</body>

</html>